#ifndef __DECIDE_H__
#define __DECIDE_H__

#include <vector>
#include <utility>
#include "transaction.h"
#include "holder.h"

namespace stock_trade{

const int MAX_NUMBER = 1000000000;
class Decide{
public:
    static Transaction decide(const std::vector<float>& features, Stock stock, 
            Date date, Time time, float buyScore, float sellScore, Holder holder, float& score);
    static std::pair<std::vector<std::pair<Transaction, float> >, std::vector<std::pair<Transaction, float> > > decideAll(const std::vector<std::vector<float> >& allFeatures, const std::vector<Stock>& vecStock, Date date, Time time, float buyScore, float sellScore, Holder holder);
    static int DecideNumber(const std::vector<float>& features, const Transaction& transaction, const Holder& holder, float score, float buyScore, float sellScore);
    static int GetNumber(float money, float price, const int min_number);
    static std::vector<Transaction> decisionAll(std::vector<Stock> vecStock, Holder& holder, Date startDate, Date endDate, 
            Time startTime, Time endTime, float buyScore, float sellScore);
    static std::vector<Transaction> decisionAll(std::vector<Stock> vecStock, Holder& holder, Date date, Time time, float buyScore, float sellScore);
};

}
bool decrease(const std::pair<stock_trade::Transaction, float>& t1, const std::pair<stock_trade::Transaction, float>& t2);
bool increase(const std::pair<stock_trade::Transaction, float>& t1, const std::pair<stock_trade::Transaction, float>& t2);
#endif
